
#ifndef COLLIDER_H_
#define COLLIDER_H_

#include "Core.h"
#include "Entity.h"
#include "ContactSolver.h"
#include "ConvexPolygon.h"
#include "Disc.h"

#ifdef DEBUG
#	define DRAW_CONTACTS			0
#endif

namespace p2 {

class Collider
{
public:
	inline Collider();
	virtual ~Collider();

	bool collide(Element* a, Element* b);

	inline Contact::List& getContacts();

private:
	bool collidePolygonPolygon(ConvexPolygon* a, ConvexPolygon* b);
	bool collidePolygonDisc(ConvexPolygon* a, Disc* b);
	bool collideDiscDisc(Disc* a, Disc* b);

private:
	Contact::List _contacts;
};

inline Collider::Collider()
{
}

inline Contact::List& Collider::getContacts()
{
	return _contacts;
}

}

#endif	//COLLIDER_H_
